package EnumDemo;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/7/16-07-16-14:16
 * @Description：枚举嵌套枚举，把Food菜谱存放到一个Meal菜单中，通过这种方式统一管理菜单的数据
 */
public enum Enum_Meal {
    APPETIZER(Food.Appetizer.class),
    MAINCOURSE(Food.MainCourse.class),
    DESSERT(Food.Dessert.class),
    COFFEE(Food.Coffee.class);

    private  Food[] values;
    private Enum_Meal(Class<? extends Food> kind) {
        //通过class对象获取枚举案例
        values = kind.getEnumConstants();
        System.out.println(values);
    }
//    public interface Food{
//        enum Appetizer implements EnumDemo.Food {
//            SALAD,SOUP,SPRING_ROLLS;
//        }
//        enum  MainCourse implements EnumDemo.Food {
//            LASAGNE, BURRITO,PAD_THAI,
//            LENTILS,HUMMOUS,VINDALOO;
//        }
//        enum Dessert implements EnumDemo.Food {
//            TIRAMISU,GELATO,BLACK_FOREST_CAKE,
//            FRUIT,CREME_CARAMEL;
//        }
//        enum Coffee implements EnumDemo.Food {
//            BLACK_COFFEE,DECAF_COFFEE,ESPRESSO,
//            LATTE,CAPPUCCINO,TEA,HERB_TEA;
//        }
//    }
}
